#!/usr/bin/python3

class StuckPredicate:
    optimism_earnings = (0.05, 0.2, 0.06)
    pessimism_earnings = (-0.3, -0.15, 0.04)
    def optimism(self, us_ratio, a_ratio, bond_ratio):
        earning = us_ratio * 1.0 * self.optimism_earnings[0] + \
                a_ratio * 1.0 * self.optimism_earnings[1] + \
                bond_ratio * 1.0 * self.optimism_earnings[2]
        return earning

    def pessimism(self, us_ratio, a_ratio, bond_ratio):
        earning =  us_ratio * 1.0 * self.pessimism_earnings[0] + \
                a_ratio * 1.0 * self.pessimism_earnings[1] + \
                bond_ratio * 1.0 * self.pessimism_earnings[2]
        return earning